import 'package:flutter/material.dart';

class MyApp14 extends StatelessWidget {
  const MyApp14({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        //导航条
        appBar: AppBar(
          title: const Text('ListView使用',
              style: TextStyle(
                  fontSize: 20,
                  fontWeight: FontWeight.bold,
                  color: Colors.white)),
          backgroundColor: Colors.pink,
          centerTitle: true,
        ),
        //主体区域
        body: ListView.builder(
          //列表的每一项
          itemBuilder: (BuildContext context, int index) {
            return Container(
                padding: EdgeInsets.only(left: 10, right: 10, top: 10),
                child: Row(children: [
                  Image.network(
                      'https://yanxuan-item.nosdn.127.net/e529b6ab111ade9da9314867f98d360f.png',
                      width: 90),
                  const SizedBox(width: 10),
                  Expanded(
                    child: Text(
                      '海尔（Haier）波轮洗衣机全自动家用 10公斤大容量 直驱变频 一级能效 高效精华洗 以旧换新EB100B37Mate5',
                      maxLines: 2,
                      overflow: TextOverflow.ellipsis,
                    ),
                  ),
                  Icon(
                    Icons.arrow_forward_ios,
                    size: 16,
                  )
                ]));
          },
          //列表的长度
          itemCount: 20,
        ));
  }
}
